package com.hzncc.flowable_diboot.entity.invoicemanage;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;
import java.lang.Double;
import java.math.BigDecimal;
import jakarta.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import com.diboot.core.util.D;
import com.diboot.core.entity.BaseModel;
import com.diboot.core.entity.BaseEntity;
import com.diboot.core.binding.query.BindQuery;
import com.diboot.core.binding.query.Comparison;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

/**
 * 开票登记 Entity 定义
 * @author MyName
 * @version 1.0
 * @date 2024-11-07
 * Copyright © MyCorp
 */
@TableName("mdl_invoice_register")
@Getter
@Setter
@Accessors(chain = true)
public class InvoiceRegister extends BaseModel {

    private static final long serialVersionUID = 1936117428701852866L;

    /**
     * 租户
     */
    @NotNull(message = "租户不能为空")
    @TableField()
    private String tenantId;

    /**
     * 是否登记
     */
    @TableField()
    private String registered;

    /**
     * 销售组织
     */
    @TableField()
    private String salesOrganization;

    /**
     * 登记类型
     */
    @Length(max = 100, message = "登记类型长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String registerType;

    /**
     * 引用开票登记号
     */
    @Length(max = 100, message = "引用开票登记号长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String quoteInvoiceCode;

    /**
     * 引用非常规开票登记号
     */
    @Length(max = 100, message = "引用非常规开票登记号长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String quoteAbnormalCode;

    /**
     * 引用冲销开票登记号
     */
    @Length(max = 100, message = "引用冲销开票登记号长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String quoteReversalCode;

    /**
     * Sap合同号
     */
    @Length(max = 100, message = "Sap合同号长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String sapContractCode;

    /**
     * 开票类型
     */
    @TableField()
    private String invoiceCategory;

    /**
     * 合同付款提醒时间
     */
    @TableField()
    private LocalDateTime planPaymentTime;

    /**
     * 销售订单号
     */
    @Length(max = 100, message = "销售订单号长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String sapOrderCode;

    /**
     * 发货单号
     */
    @Length(max = 100, message = "发货单号长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String deliveryCode;

    /**
     * Sap凭证号
     */
    @Length(max = 100, message = "Sap凭证号长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String sapCertCode;

    /**
     * Sap开票凭证日期
     */
    @TableField()
    private LocalDateTime sapInvoiceCertTime;

    /**
     * Sap发票号
     */
    @Length(max = 100, message = "Sap发票号长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String invoiceNo;

    /**
     * Sap发票行项目
     */
    @Length(max = 100, message = "Sap发票行项目长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String invoiceItem;

    /**
     * 开票日期
     */
    @TableField()
    private LocalDateTime invoiceDate;

    /**
     * 开票金额
     */
    @TableField()
    private BigDecimal invoiceAmount;

    /**
     * 付款方
     */
    @Length(max = 100, message = "付款方长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String payer;

    /**
     * 开票数量
     */
    @TableField()
    private Long invoiceCount;

    /**
     * 未收款
     */
    @TableField()
    private BigDecimal unpaidAmount;

    /**
     * 已收款
     */
    @TableField()
    private BigDecimal receivedAmount;

    /**
     * 是否收款完成
     */
    @TableField()
    private String paymentCompleted;

    /**
     * 发票类型
     */
    @TableField()
    private String invoiceType;

    /**
     * 领取人
     */
    @Length(max = 100, message = "领取人长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String claimant;

    /**
     * 运单号
     */
    @Length(max = 100, message = "运单号长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String billNo;

    /**
     * 邮寄人
     */
    @Length(max = 100, message = "邮寄人长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String sender;

    /**
     * 邮寄时间
     */
    @TableField()
    private LocalDateTime postDate;

    /**
     * 邮寄地址
     */
    @Length(max = 100, message = "邮寄地址长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String postAddress;

    /**
     * 收件人
     */
    @Length(max = 100, message = "收件人长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String receiver;

    /**
     * 联系电话
     */
    @Length(max = 100, message = "联系电话长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String contactPhone;

    /**
     * 回执单类型
     */
    @TableField()
    private String receiptType;

    /**
     * 回执日期
     */
    @TableField()
    private LocalDateTime receiptDate;

    /**
     * 退票原因
     */
    @Length(max = 100, message = "退票原因长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String refundReason;

    /**
     * 备注
     */
    @Length(max = 100, message = "备注长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String remark;

    /**
     * 附件
     */
    @Length(max = 100, message = "附件长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String attachment;

    /**
     * 回执单回执状态
     */
    @TableField()
    private String receipted;


}
